package com.hgq.tenadmin.md.contactman.controller;

import com.github.pagehelper.PageInfo;
import com.hgq.tenadmin.md.client.param.ClientParam;
import com.hgq.tenadmin.md.contactman.service.ContactManService;
import com.hgq.tencommon.common.R;
import com.hgq.tencommon.entity.md.client.MdClient;
import com.hgq.tencommon.entity.md.contactman.ContactMan;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/md/contactman")
public class ContactManController {
    @Resource
    private ContactManService contactManService;
    @GetMapping("/list")
    public R list(String linkClient, String salePrincipal, int pageNum, int pageSize){
        PageInfo<ContactMan> contact = contactManService.selectAllContact(linkClient,salePrincipal, pageNum, pageSize);
        return R.ok(contact);
    }

    @PostMapping("/save")
    public R save(@RequestBody ContactMan contactMan){
        contactManService.insertOneContactMan(contactMan);
        return R.ok();
    }

}
